#ifndef __RTC_H__
#define __RTC_H__

typedef struct
{
    
    unsigned char hour;
    unsigned char minute;
    unsigned char second;
    
    unsigned char day;
    unsigned char month;
    unsigned short year;
    
    unsigned int offset;
    
} VBB_RTC; 

void vbb_RTC_Init(VBB_RTC * Rtc);
void vbb_RTC_Update(VBB_RTC * Rtc);
void vbb_RTC_Save(VBB_RTC * Rtc, unsigned int CurrentSec);
unsigned int vbb_RTC_GetSec(void);
unsigned int vbb_RTC_GetCurrSec(void);
void vbb_RTC_Set(unsigned int NewTime);

void vbb_RTC_Convert(unsigned int Time, int * HourMinSec, int * DayMonthYear);

#define SAVE_HEADER                     0
#define SAVE_RTC                        1
#define SAVE_RTC_TIMEOFFSET             2

#endif
